package com.jmp.api.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author cjr
 */
@Data
@Builder
public class OrderConfirmResponse {
    @ApiModelProperty(value = "收货地址，可能为空", dataType = "OrderConfirmResponse.Address")
    private Address address;
    @ApiModelProperty(value = "店铺商品列表", dataType = "OrderConfirmResponse.Supplier")
    private List<Supplier> supplierList;

    @ApiModelProperty("总件数")
    private Integer total;
    @ApiModelProperty("总价")
    private BigDecimal totalPrice;

    @ApiModel("OrderConfirmResponse.Address")
    @Data
    @Builder
    public static class Address {
        @ApiModelProperty("收货地址ID")
        private Integer addressId;
        @ApiModelProperty("收货人")
        private String receiveName;
        @ApiModelProperty("收货电话")
        private String receivePhone;
        @ApiModelProperty("收货地址")
        private String address;
    }

    @ApiModel("OrderConfirmResponse.Supplier")
    @Data
    @Builder
    public static class Supplier {
        @ApiModelProperty("店铺ID")
        private Integer companyId;
        @ApiModelProperty("店铺名称")
        private String companyName;
        @ApiModelProperty("店铺图片")
        private String companyLogo;
        @ApiModelProperty(value = "商品列表", dataType = "OrderConfirmResponse.Goods")
        private List<Goods> goodsList;
        @ApiModelProperty("总价")
        private BigDecimal totalPrice;
    }

    @ApiModel("OrderConfirmResponse.Goods")
    @Data
    @Builder
    public static class Goods {
        @ApiModelProperty("购物车ID,可为空")
        private Integer shopChatId;
        @ApiModelProperty("商品ID")
        private Integer goodsId;
        @ApiModelProperty("规格ID")
        private Integer goodsSpecId;
        @ApiModelProperty("商品主图")
        private String photo;
        @ApiModelProperty("商品名称")
        private String name;
        @ApiModelProperty("商品SKU名称")
        private String specName;
        @ApiModelProperty("购买数量")
        private Integer num;
        @ApiModelProperty("价格")
        private BigDecimal price;
        @ApiModelProperty("拼团ID,可为空")
        private Integer groupId;
    }
}
